@extends('admin/layout/index')

@section('css')

<link rel="stylesheet" href="/web/css/page_page.css">

@endsection

@section('content')
	<div class="mws-panel grid_8">
		<div class="mws-panel-header">
			<span><i class="icon-table"></i>友情链接列表</span>
		</div>
		<div class="mws-panel-body no-padding">
		    <div id="DataTables_Table_1_wrapper" class="dataTables_wrapper" role="grid">
		    	<form action="/admin/link/index" method="get">
				    <div id="DataTables_Table_1_length" class="dataTables_length">
					    <label>显示 :
						    <input type="text" style="width:70px;" name="tiao" value="{{ $request['tiao'] or 10 }}"> 条
					    </label>
				    </div>
				    <div class="dataTables_filter" id="DataTables_Table_1_filter">
					    <label>查找: <input aria-controls="DataTables_Table_1" type="text" name="search" value="{{ $request['search'] or '' }}">
					    </label>
					    <input type="submit" class="btn btn-small" value="搜索">

				    </div>

			    </form> 
			    <table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info">
			        <thead>
			            <tr role="row">
			                <th class="sorting_asc" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 143px;" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending">序号</th>
			                <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 195px;" aria-label="Browser: activate to sort column ascending">链接名称</th>
			                <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 181px;" aria-label="Platform(s): activate to sort column ascending">链接URL</th>
			                <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 121px;" aria-label="Engine version: activate to sort column ascending">链接Logo</th>
			                <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 87px;" aria-label="CSS grade: activate to sort column ascending">链接描述</th>
			                <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 87px;" aria-label="CSS grade: activate to sort column ascending">创建时间</th>
			                <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 87px;" aria-label="CSS grade: activate to sort column ascending">是否开启</th>
			                <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 87px;" aria-label="CSS grade: activate to sort column ascending">操作</th>
			            </tr>
			        </thead>
			     @foreach ($data as $k => $v)   
			    <tbody role="alert" aria-live="polite" aria-relevant="all" style="text-align:center;">
			    	<tr class="odd">

			    		
			            <td class="  sorting_1">  {{$i++}}  </td>
			            
			            <td class=" ">{{ $v['linkname'] }}</td>
			            <td class=" ">{{ $v['linkurl'] }}</td>
			            <td class=" "><img src="/uploads/images/linkpic/{{ $v['pic'] }}" alt="" width="30" hieght="30"></td>
			            <td class=" ">{{ $v['description'] }}</td>
			            <td class=" ">{{date('Y-m-d', $v['ctime'])}}</td>
			            <td class=" ">@if($v['status'] == 1) 是 @else 否 @endif</td>
			            <td class=" " width="150">
							<a href="/admin/link/delete/{{$v['id']}}?page={{$request['page'] or 1}}&tiao={{$request['tiao'] or 10}}&search={{$request['search'] or ''}}" style="color:black;font-size:20px;margin-left:5px;margin-right:5px;" title="删除" onclick="return confirm('确认要删除吗?')"><i class="icon-remove" ></i></a>
                            <a href="/admin/link/edit/{{$v['id']}}?page={{$request['page'] or 1}}&tiao={{$request['tiao'] or 10}}&search={{$request['search'] or ''}}" style="color:black;font-size:20px;margin-left:5px;margin-right:5px;" title="编辑"><i class="icon-pencil-2" ></i></a>
                            <a href="/admin/link/add" style="color:black;font-size:20px;margin-left:5px;margin-right:5px;" title="添加"><i class="icon-plus" ></i></a>
			            </td>
			        </tr>
			    </tbody>
			    @endforeach
			    </table>
			    <div class="dataTables_info" id="DataTables_Table_1_info">显示  @if (empty($request['tiao'])) @if ($i < 10) 0  @else {{ $i - 10 }} @endif 到 {{ $i - 1 }} @else  @if ($i < 10) 0  @else  {{ $i - $request['tiao'] }} @endif 到 {{ $i - 1 }} @endif  共 {{$count}} 条</div>
			     <div id="page_page" >
				   {!! $data -> appends($request) -> render() !!}
			    </div>
		    </div>
		</div>
	</div>

@endsection